let objectUtils = {
	freeze: (obj) => {
		if (Object.isFrozen(obj)) {
			return obj;
		}
		Object.keys(obj).forEach(item => {
			typeof obj[item] === "object" ? objectUtils.freeze(obj[item]) : obj[item];
		})
		return Object.freeze(obj);
	},
	bindMethod(obj, name, fn) {
		var old = obj[name];
		obj[name] = function() {
			if (fn.length == arguments.length) {
				return fn.apply(this, arguments);
			} else {
				return old.apply(this, arguments);
			}
		}
	}
}
export default objectUtils.freeze(objectUtils);